import emitter from "../emitter";

const { ccclass, property } = cc._decorator;

@ccclass
export default class eggCollider extends cc.Component {
    isCollider = false;
    onCollisionEnter(other, self) {
        if (this.isCollider) return
        emitter.emit("eggDestroy", self.node.parent);
        emitter.emit("putEnemyBullet", other.node.parent);
    }

    onCollisionExit() {
        this.isCollider = false;
    }
}
